package org.exhibitj.operators;

import org.eclipse.swt.widgets.Display;

public class SWTDisplayThread {

	public static void asyncExec(Runnable runner) {
		Display.getDefault().asyncExec(runner);
	}

	public static <T> T fetch(FetchingRunnable<T> visible) {
		Display.getDefault().syncExec(visible);
		return visible.getValue();
	}

	public static void syncExec(Runnable runner) {
		Display.getDefault().asyncExec(runner);
	}
}
